<template>
  <div class="addVideo">
    <h3>上传/编辑视频</h3>
    <el-form :model="addForm" label-width="100px">
      <el-row>
        <el-col :span="10">
          <el-form-item label="食安标题">
            <div>{{ addForm.safetyTitle }}</div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item
            label="食安分类"
            prop="safetyCategory"
            class="is-required"
          >
            <div>{{ addForm.safetyCategory }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="是否推荐" prop="isrecommendChecked">
            <div>{{ addForm.isrecommend }}</div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="视频封面" prop="name" class="is-required">
            <el-image
              style="width: 370px; height: 200px"
              :src="addForm.coverImg"
            >
            </el-image>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="上传视频" prop="name">
            <video
              controls
              :src="addForm.videoUrl"
              height="200px"
              width="80%"
            ></video>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
export default {
  props: {},
  data() {
    return {
      addForm: {
        coverImg: "",
        id: "",
        isrecommend: 0,
        isrecommendChecked: false,
        safetyCategory: "",
        safetyState: 0,
        safetyTitle: "",
        videoUrl: "",
      },
      dialogVisible: false,
      dialogImage: false,
      unitModuleTaskFileSaveRequestList: [],
    };
  },
  computed: {
    hideUpload() {
      return this.unitModuleTaskFileSaveRequestList.length >= 1;
    },
  },
  created() {
    if (sessionStorage.getItem("classroom")) {
      let data = JSON.parse(sessionStorage.getItem("classroom"));
      this.addForm = data;
    }
  },
  mounted() {},
  destroyed() {
    sessionStorage.removeItem("classroom");
  },
};
</script>
<style scoped lang="scss">
.is-required {
  /deep/.hide .el-upload--picture-card {
    display: none;
  }
}
</style>

